package com.st.service.impl;

import com.st.dao.IAdminDao;
import com.st.dao.ICartDao;
import com.st.entity.Admin;
import com.st.entity.Cart;
import com.st.service.IAdminService;
import com.st.service.ICartService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class CartService implements ICartService {
   @Autowired
   private ICartDao cartDao;


    @Override
    public List<Cart> query(Cart cart) {
        return cartDao.query(cart);
    }

    @Override
    public Integer add(Cart cart) {
        return cartDao.add(cart);
    }

    @Override
    public Integer update(Cart cart) {
        return cartDao.update(cart);
    }

    @Override
    public Integer del(Integer id) {
        return cartDao.del(id);
    }

    @Override
    public List<Cart> queryEmpty(String ids) {
        Map<String, String> map = new HashMap<>();
        map.put("ids", ids);
        return cartDao.queryEmpty(map);
    }
}
